package com.platform.modules.wallet.service.impl;

import cn.hutool.core.date.DateUtil;
import com.platform.common.enums.YesOrNoEnum;
import com.platform.common.web.service.impl.BaseServiceImpl;
import com.platform.modules.wallet.domain.WalletAlarm;
import com.platform.modules.wallet.service.WalletAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service("walletAlarmService")
public class WalletAlarmServiceImpl extends BaseServiceImpl<WalletAlarm> implements WalletAlarmService {
    @Override
    public void addAlarm(String content) {

        WalletAlarm bean = getBean();
        bean.setContent(content);
        bean.insert();
    }

    private WalletAlarm getBean() {
        WalletAlarm bean = new WalletAlarm();
        bean.setIsRead(YesOrNoEnum.NO);
        bean.setCreateTime(DateUtil.date());
        bean.setCreateDate(DateUtil.date());
        return bean;
    }
}
